<?php

namespace App\Http\Controllers\Internal\OpenShop;

use App\Http\Controllers\BaseController;
use App\Http\Validate\OpenShop\InvestmentPromotion\OrderValidate;
use App\Jobs\OpenShop\PayCsv;
use App\Library\Rms\RmsSysApi;
use App\Service\OpenShop\OrderService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;

class PayController extends BaseController
{
    public function downloadPayDetail(Request $request)
    {
        $startTime = $request->get('startTime');
        $chat_id   = $request->get('chat_id');

        $this->validate($request, [
            'startTime' => 'required|integer',
            'chat_id'   => 'required|string',
        ]);

        dispatch((new PayCsv($startTime, time(), $chat_id)));

//        $send = (new RmsSysApi())->sendRobotMessage('ok...'.$startTime, 'oc_237a89b245bbe3144e89c04ad4909103');

        return $this->success();

    }
}
